package com.itheima.a09threadsafe1;

public class ThreadDemo1 {
    public static void main(String[] args) {
        //熟悉同步代码块（锁）

        //模拟3个窗口卖100张票

        //创建线程对象
        MyThread mt1 = new MyThread();
        MyThread mt2 = new MyThread();
        MyThread mt3 = new MyThread();

        //设置线程名称
        mt1.setName("窗口1");
        mt2.setName("窗口2");
        mt3.setName("窗口3");

        //启动线程
        mt1.start();
        mt2.start();
        mt3.start();

    }
}
